-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify the admin REST API #3753
Unify the admin REST API #3753
Conversation
b88e1d5
to
fc6f102
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportBase: 81.16% // Head: 82.42% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## feature/unified-rest-api #3753 +/- ##
============================================================
+ Coverage 81.16% 82.42% +1.26%
============================================================
Files 528 537 +9
Lines 33918 34342 +424
============================================================
+ Hits 27528 28308 +780
+ Misses 6390 6034 -356
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
fc6f102
to
7b5ad43
Compare
This comment was marked as outdated.
This comment was marked as outdated.
7b5ad43
to
e8c07d3
Compare
This comment was marked as outdated.
This comment was marked as outdated.
e8c07d3
to
6e2f869
Compare
This comment was marked as outdated.
This comment was marked as outdated.
6e2f869
to
d98778a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
d98778a
to
87d040e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
87d040e
to
34563f3
Compare
This comment was marked as outdated.
This comment was marked as outdated.
34563f3
to
e188066
Compare
This comment was marked as outdated.
This comment was marked as outdated.
e188066
to
8006dc5
Compare
This comment was marked as outdated.
This comment was marked as outdated.
8006dc5
to
a3efc38
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
d216d14
to
dc8106a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
dc8106a
to
d03b6aa
Compare
This comment was marked as outdated.
This comment was marked as outdated.
d03b6aa
to
f4474a6
Compare
910e000
to
e7edf6d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
e7edf6d
to
970b7e4
Compare
This comment was marked as outdated.
This comment was marked as outdated.
da093a3
to
57452bb
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This module will delegate Admin REST API calls to the handler modules, just like mongoose_client_api is doing for client API requests.
Also: fix types in mod_roster_api
Also: fix types in mongoose_stanza_api Marked missing error handling as TO DO - it will be done in a separate task.
Also: fix types and whitespace in mod_inbox_api
Also: fix types in mod_muc_api
Also: fix types and typos (sic!) in MUC Light modules
- Update expected messages - Actually test message errors for MUC (invites were tested instead) - Remove tests for listing commands and adding mongoose_commands Command listing will be possible only with GraphQL, and mongoose_commands will be removed in a follow-up PR. Also: remove test repeat
57452bb
to
9b05bf2
Compare
Also: reorganize tests for easier management
9b05bf2
to
4583d13
Compare
small_tests_24 / small_tests / 9b05bf2 small_tests_25 / small_tests / 9b05bf2 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 9b05bf2 ldap_mnesia_24 / ldap_mnesia / 9b05bf2 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 9b05bf2 dynamic_domains_mysql_redis_25 / mysql_redis / 9b05bf2 ldap_mnesia_25 / ldap_mnesia / 9b05bf2 internal_mnesia_25 / internal_mnesia / 9b05bf2 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 9b05bf2 pgsql_mnesia_24 / pgsql_mnesia / 9b05bf2 elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 9b05bf2 mysql_redis_25 / mysql_redis / 9b05bf2 pgsql_mnesia_25 / pgsql_mnesia / 9b05bf2 riak_mnesia_24 / riak_mnesia / 9b05bf2 mssql_mnesia_25 / odbc_mssql_mnesia / 9b05bf2 |
small_tests_24 / small_tests / 4583d13 small_tests_25 / small_tests / 4583d13 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 4583d13 ldap_mnesia_24 / ldap_mnesia / 4583d13 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 4583d13 ldap_mnesia_25 / ldap_mnesia / 4583d13 dynamic_domains_mysql_redis_25 / mysql_redis / 4583d13 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 4583d13 muc_SUITE:hibernation:hibernated_room_can_be_queried_for_archive{error,{{assertion_failed,assert,is_groupchat_message,
[<<"Restorable message">>],
undefined,"undefined"},
[{escalus_new_assert,assert_true,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{muc_SUITE,wait_for_mam_result,3,
[{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
{line,4394}]},
{muc_SUITE,'-hibernated_room_can_be_queried_for_archive/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
{line,4130}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{muc_SUITE,hibernated_room_can_be_queried_for_archive,1,
[{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
{line,4126}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} internal_mnesia_25 / internal_mnesia / 4583d13 riak_mnesia_24 / riak_mnesia / 4583d13 elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 4583d13 pgsql_mnesia_25 / pgsql_mnesia / 4583d13 mysql_redis_25 / mysql_redis / 4583d13 mssql_mnesia_25 / odbc_mssql_mnesia / 4583d13 muc_SUITE:hibernation:hibernated_room_can_be_queried_for_archive{error,{{assertion_failed,assert,is_groupchat_message,
[<<"Restorable message">>],
undefined,"undefined"},
[{escalus_new_assert,assert_true,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{muc_SUITE,wait_for_mam_result,3,
[{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
{line,4394}]},
{muc_SUITE,'-hibernated_room_can_be_queried_for_archive/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
{line,4130}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{muc_SUITE,hibernated_room_can_be_queried_for_archive,1,
[{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
{line,4126}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} pgsql_mnesia_24 / pgsql_mnesia / 4583d13 service_mongoose_system_metrics_SUITE:system_metrics_are_reported_to_configurable_google_analytics{error,
{{assertEqual,
[{module,service_mongoose_system_metrics_SUITE},
{line,470},
{expression,"ActualTrackingIds"},
{expected,[<<"UA-151671255-1">>,<<"UA-EXTRA-TRACKING-ID">>]},
{value,[<<"UA-151671255-1">>]}]},
[{service_mongoose_system_metrics_SUITE,
events_are_reported_to_tracking_ids,1,
[{file,
"/home/circleci/project/big_tests/tests/service_mongoose_system_metrics_SUITE.erl"},
{line,470}]},
{service_mongoose_system_metrics_SUITE,
system_metrics_are_reported_to_configurable_google_analytics,1,
[{file,
"/home/circleci/project/big_tests/tests/service_mongoose_system_metrics_SUITE.erl"},
{line,204}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}} dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 4583d13 inbox_extensions_SUITE:async_pools:one_to_one:mute_muted_entry_gets_unmuted{error,
{{assert,
[{module,inbox_extensions_SUITE},
{line,798},
{expression,"escalus_pred : is_message ( Message )"},
{expected,true},
{value,false}]},
[{inbox_extensions_SUITE,check_message_with_properties,4,
[{file,
"/home/circleci/project/big_tests/tests/inbox_extensions_SUITE.erl"},
{line,798}]},
{inbox_extensions_SUITE,set_inbox_properties,4,
[{file,
"/home/circleci/project/big_tests/tests/inbox_extensions_SUITE.erl"},
{line,792}]},
{inbox_extensions_SUITE,'-mute_muted_entry_gets_unmuted/1-fun-2-',2,
[{file,
"/home/circleci/project/big_tests/tests/inbox_extensions_SUITE.erl"},
{line,568}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} pgsql_mnesia_24 / pgsql_mnesia / 4583d13 mssql_mnesia_25 / odbc_mssql_mnesia / 4583d13 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 4583d13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks cool
The main goal is to have the following structure for the Admin REST API:
mongoose_admin_api
implementsmongoose_http_handler
mongoose_admin_api_*
implement the individual command categories.This is the same as for the Client API, making the two unified.
The new handler modules are using exceptions for error handling, which makes it less error-prone, as it is easier to read the logic and check if all cases are covered. The previous de-facto convention of multiple nested
case
constructs was less readable.The following future work is excluded from this PR to reduce its size:
mongoose_admin_api
instead ofmongoose_api_admin
mongoose_api_admin
mongoose_commands
mongoose_domain_handler
andmongoose_api
(yet another admin API) to usemongoose_admin_api